package cn.woblog.android.http.callback;

import cn.woblog.android.http.AppException;
import cn.woblog.android.http.RequestTask;

import com.squareup.okhttp.Request;
import com.squareup.okhttp.Response;

public interface ICallback<T> {
	void onFailure(Request request, AppException e);

	T bindData(Response response, Request request, RequestTask<T> task) throws AppException;

	T bindData(String response, RequestTask<T> task) throws AppException;

	void onSuccess(Response response, T data);

	T preRequest();

	T postRequest(T result);

	ICallback<T> cache(String key);
}
